import router from './router'
import store from './store'

router.beforeEach((to, from, next) => {
  console.log(from.path, ' = > ', to.path)
  store.dispatch('app/generateRoutes').then((routes) => {
    router.addRoutes(routes)
  }).finally(() => {
    next()
  })
})
